package com.szeastroc.core.mapper.system;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.szeastroc.core.base.mapper.BaseMapper;
import com.szeastroc.core.bean.system.SystemRole;

/**
 * Created by jie on 2018/1/13.
 */
public interface SystemRoleMapper extends BaseMapper<SystemRole>{

    @Select("SELECT * FROM `t_system_role` WHERE id IN( SELECT role_id AS id FROM `t_system_user_role` WHERE user_id = #{userId})")
    List<SystemRole> selectRolesByUserId(@Param("userId") Integer userId);
}
